<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of mManageUser
 *
 * @author SG10015
 */


$q = isset($_POST['q']) ? strval($_POST['q']) : '';
$rs = @mysql_query("SELECT a.CURR_ID, a.COMP_CODE, b.COMP_DESC, a.CURR_VAL_FROM, a.CURR_FROM, a.CURR_VAL_TO, a.CURR_TO,
                            case a.CURR_ACTIVE  
                                when '1' then 'Aktif'
                                when '0' then 'Tidak Aktif'  
                            end as CURR_ACTIVE                             
                        FROM trv_tcurrency a, trv_mcompanycode b
                       WHERE a.COMP_CODE=b.COMP_CODE and a.CURR_ACTIVE='1' and COMP_DESC like '%".$q."%'");
$rows = array();
while($row = @mysql_fetch_assoc($rs)){
	$rows[] = $row;
}
echo json_encode($rows);
?>
